#!/bin/bash
# description: Install tigervnc server for UOS desktop professional
# version: 0.0.1
# author: ZhangChiQian<zhangchiqian@uniontech.com>
# date: 2021-11-29
echo "+------------------------------------------+"
echo "|   开始卸载tigervnc-scraping-server		"
echo "+------------------------------------------+"

echo -e "\033[40;37m 正在停止x0vncserver进程 \033[0m"
sudo killall x0vncserver
if dpkg -l tigervnc-common &>/dev/null || dpkg -l tigervnc-standalone-server &>/dev/null ;then
    echo "正在卸载tigervnc server"
    sudo dpkg -P tigervnc-common tigervnc-scraping-server
fi
sudo rm -f /etc/systemd/system/x0vncserver.service
sudo systemctl daemon-reload
if [ $? -eq 0 ];then
    echo -e "\033[40;37m 卸载完成，按回车意键退出 \033[0m"
    read i
    exit 0
fi